package InterfaceGrafica;

import java.awt.Graphics;

import javax.swing.JComponent;

public class MyTabel extends JComponent{
	private int numCol;
	private int numLines;

	public MyTabel(int numCol, int numLines) {
		this.numCol = numCol;
		this.numLines = numLines;
	}

	@Override
	public void paint(Graphics g) {
		super.paint(g);
		
		for (int i = 1; i != numLines + 1; i++) {
			for (int j = 1; j != numCol + 1; j++) {

				g.drawLine(getWidth() / numCol * j, 0, getWidth() / numCol * j,
						getHeight());// colunas

			}
			g.drawLine(0, getHeight() / numLines * i, getWidth(), getHeight()
					/ numLines * i);// linhas
			
		}
	}

}
